<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE composition
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
                template="layout.xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:define name="content">
        <h:outputLabel value="#{mapBean.doIt()}"/>
        <f:view contentType="text/html">
        <h:form id="albumInfos">
        <h2><h:outputLabel value="#{albumController.albumName}"/></h2>
            <h:commandLink value="#{msg.editAlbum}" action="#{createEditAlbumController.ladeAlbum}" rendered="#{userController.eingeloggt and userController.nutzerID == albumController.erstellerID}">
                <f:param name="AlbumName" value="#{albumController.albumName}"/>
            </h:commandLink>
        <br/><br/>
        <h3><h:outputLabel value="#{albumController.albumBeschreibung}"/></h3>
        <h:outputLabel value="#{msg.passwordInput}" rendered="#{userController.nutzerID != albumController.erstellerID}"/> <h:inputText id="passwordInput" value="#{albumController.passwortEingabe}" rendered="#{userController.nutzerID != albumController.erstellerID}"/><h:commandButton value="#{msg.showAllPictures}" action="#{albumController.showAllPictures}" rendered="#{userController.nutzerID != albumController.erstellerID}"/>
        <br/>
        <h:message for="passwordInput" style="color:red;"/>
        <h:outputLabel value="#{msg.passwordForFriends} #{albumController.passwort}" rendered="#{userController.eingeloggt and userController.nutzerID == albumController.erstellerID}"/>
        <br/>
             <p:galleria id="images" effect="fade" effectSpeed="1000">
                <ui:repeat value="#{albumController.bilder}" var="pics">
                    <h:outputLabel value="#{albumController.getImage(pics.name)}"/>
                    <p:graphicImage value="#{albumController.picture}"
                        title="#{pics.name}" alt="#{pics.beschreibung}">
                    </p:graphicImage>
                </ui:repeat>
             </p:galleria>


            <br/><br/>
            <p align="center">
                <p:gmap center="#{albumController.bilder[0].latitude}, #{albumController.bilder[0].longitude}" zoom="13" type="HYBRID" style="width:600px;height:400px"
                    model="#{mapBean.simpleModel}" overlaySelectListener="#{mapBean.onMarkerSelect}">
                    <p:gmapInfoWindow>
                        <p:graphicImage value="#{mapBean.image}" width="200" height="150"/>
                        <br/>
                        <h:outputText value="#{mapBean.beschreibung}"/>
                    </p:gmapInfoWindow>
                </p:gmap>
            </p>
        </h:form>
        </f:view>
    </ui:define>
</ui:composition>